using System;
using System.Collections.Generic;


namespace LiveCS.Models
{
	[Serializable]
	public class Temporarymember: IEquatable<Temporarymember>
	{

		#region Private Members

		private string _cardid; 
		private IList<Fightingmember> _FightingmemberList; 
		private IList<Historyfightingmember> _HistoryfightingmemberList; 
		private IList<Teaminformation> _TeaminformationList; 
		private IList<Waitingmember> _WaitingmemberList; 
		private IList<Consumemoney> _ConsumemoneyList; 
		private string _username; 
		private string _nickname; 
		private string _usersex; 
		private int _userage; 
		private string _useraddress; 
		private string _teamname; 
		private string _regestionname; 
		private DateTime _regestiondate; 
		private decimal _deposit; 
		private decimal _usermoney; 
		private DateTime _expiredate; 
		private int _userscore; 
		private string _photourl; 
		private string _userremark; 
		private string _isperson; 		
		#endregion

		#region Constructor

		public Temporarymember()
		{
			_cardid = String.Empty; 
			_FightingmemberList = new List<Fightingmember>(); 
			_HistoryfightingmemberList = new List<Historyfightingmember>(); 
			_TeaminformationList = new List<Teaminformation>(); 
			_WaitingmemberList = new List<Waitingmember>(); 
			_ConsumemoneyList = new List<Consumemoney>(); 
			_username = String.Empty; 
			_nickname = String.Empty; 
			_usersex = String.Empty; 
			_userage = 0; 
			_useraddress = String.Empty; 
			_teamname = String.Empty; 
			_regestionname = String.Empty; 
			_regestiondate = DateTime.MinValue; 
			_deposit = 0; 
			_usermoney = 0; 
			_expiredate = DateTime.MinValue; 
			_userscore = 0; 
			_photourl = String.Empty; 
			_userremark = String.Empty; 
			_isperson = String.Empty; 
		}
		#endregion // End of Default ( Empty ) Class Constuctor

		#region Required Fields Only Constructor
		/// <summary>
		/// required (not null) fields only constructor
		/// </summary>
		public Temporarymember(
			string cardid)
			: this()
		{
			_cardid = cardid;
			_username = String.Empty;
			_nickname = String.Empty;
			_usersex = String.Empty;
			_userage = 0;
			_useraddress = String.Empty;
			_teamname = String.Empty;
			_regestionname = String.Empty;
			_regestiondate = DateTime.MinValue;
			_deposit = 0;
			_usermoney = 0;
			_expiredate = DateTime.MinValue;
			_userscore = 0;
			_photourl = String.Empty;
			_userremark = String.Empty;
			_isperson = String.Empty;
		}
		#endregion // End Constructor

		#region Public Properties
			
		public virtual string Cardid
		{
			get
			{ 
				return _cardid;
			}

			set	
			{	
				if( value == null )
					throw new ArgumentOutOfRangeException("Null value not allowed for Cardid", value, "null");
				
				if(  value.Length > 40)
					throw new ArgumentOutOfRangeException("Invalid value for Cardid", value, value.ToString());
				
				_cardid = value;
			}
		}
			
		public virtual IList<Fightingmember> FightingmemberList
		{
			get
			{
				return _FightingmemberList;
			}
			set
			{
				_FightingmemberList = value;
			}
		}

		public virtual IList<Historyfightingmember> HistoryfightingmemberList
		{
			get
			{
				return _HistoryfightingmemberList;
			}
			set
			{
				_HistoryfightingmemberList = value;
			}
		}

		public virtual IList<Teaminformation> TeaminformationList
		{
			get
			{
				return _TeaminformationList;
			}
			set
			{
				_TeaminformationList = value;
			}
		}

		public virtual IList<Waitingmember> WaitingmemberList
		{
			get
			{
				return _WaitingmemberList;
			}
			set
			{
				_WaitingmemberList = value;
			}
		}

		public virtual IList<Consumemoney> ConsumemoneyList
		{
			get
			{
				return _ConsumemoneyList;
			}
			set
			{
				_ConsumemoneyList = value;
			}
		}

		public virtual string UserName
		{
			get
			{ 
				return _username;
			}

			set	
			{	
				if(  value != null &&  value.Length > 40)
					throw new ArgumentOutOfRangeException("Invalid value for UserName", value, value.ToString());
				
				_username = value;
			}
		}
			
		public virtual string NickName
		{
			get
			{ 
				return _nickname;
			}

			set	
			{	
				if(  value != null &&  value.Length > 40)
					throw new ArgumentOutOfRangeException("Invalid value for NickName", value, value.ToString());
				
				_nickname = value;
			}
		}
			
		public virtual string UserSex
		{
			get
			{ 
				return _usersex;
			}

			set	
			{	
				if(  value != null &&  value.Length > 2)
					throw new ArgumentOutOfRangeException("Invalid value for UserSex", value, value.ToString());
				
				_usersex = value;
			}
		}
			
		public virtual int UserAge
		{
			get
			{ 
				return _userage;
			}
			set
			{
				_userage = value;
			}

		}
			
		public virtual string UserAddress
		{
			get
			{ 
				return _useraddress;
			}

			set	
			{	
				if(  value != null &&  value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for UserAddress", value, value.ToString());
				
				_useraddress = value;
			}
		}
			
		public virtual string TeamName
		{
			get
			{ 
				return _teamname;
			}

			set	
			{	
				if(  value != null &&  value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for TeamName", value, value.ToString());
				
				_teamname = value;
			}
		}
			
		public virtual string RegestionName
		{
			get
			{ 
				return _regestionname;
			}

			set	
			{	
				if(  value != null &&  value.Length > 40)
					throw new ArgumentOutOfRangeException("Invalid value for RegestionName", value, value.ToString());
				
				_regestionname = value;
			}
		}
			
		public virtual DateTime RegestionDate
		{
			get
			{ 
				return _regestiondate;
			}
			set
			{
				_regestiondate = value;
			}

		}
			
		public virtual decimal Deposit
		{
			get
			{ 
				return _deposit;
			}
			set
			{
				_deposit = value;
			}

		}
			
		public virtual decimal UserMoney
		{
			get
			{ 
				return _usermoney;
			}
			set
			{
				_usermoney = value;
			}

		}
			
		public virtual DateTime ExpireDate
		{
			get
			{ 
				return _expiredate;
			}
			set
			{
				_expiredate = value;
			}

		}
			
		public virtual int UserScore
		{
			get
			{ 
				return _userscore;
			}
			set
			{
				_userscore = value;
			}

		}
			
		public virtual string Photourl
		{
			get
			{ 
				return _photourl;
			}

			set	
			{	
				if(  value != null &&  value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for Photourl", value, value.ToString());
				
				_photourl = value;
			}
		}
			
		public virtual string UserRemark
		{
			get
			{ 
				return _userremark;
			}

			set	
			{	
				if(  value != null &&  value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for UserRemark", value, value.ToString());
				
				_userremark = value;
			}
		}
			
		public virtual string IsPerson
		{
			get
			{ 
				return _isperson;
			}

			set	
			{	
				if(  value != null &&  value.Length > 2)
					throw new ArgumentOutOfRangeException("Invalid value for IsPerson", value, value.ToString());
				
				_isperson = value;
			}
		}
			
				
		#endregion 

		#region Public Functions

		public virtual void AddFightingmember(Fightingmember obj)
		{
			#region Check if null
			if (obj == null)
				throw new ArgumentNullException("obj", "El parametro no puede ser nulo");
			#endregion
			_FightingmemberList.Add(obj);
		}
		

		public virtual void AddHistoryfightingmember(Historyfightingmember obj)
		{
			#region Check if null
			if (obj == null)
				throw new ArgumentNullException("obj", "El parametro no puede ser nulo");
			#endregion
			_HistoryfightingmemberList.Add(obj);
		}
		

		public virtual void AddTeaminformation(Teaminformation obj)
		{
			#region Check if null
			if (obj == null)
				throw new ArgumentNullException("obj", "El parametro no puede ser nulo");
			#endregion
			_TeaminformationList.Add(obj);
		}
		

		public virtual void AddWaitingmember(Waitingmember obj)
		{
			#region Check if null
			if (obj == null)
				throw new ArgumentNullException("obj", "El parametro no puede ser nulo");
			#endregion
			_WaitingmemberList.Add(obj);
		}
		

		public virtual void AddConsumemoney(Consumemoney obj)
		{
			#region Check if null
			if (obj == null)
				throw new ArgumentNullException("obj", "El parametro no puede ser nulo");
			#endregion
			_ConsumemoneyList.Add(obj);
		}
		

		#endregion //Public Functions

		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Temporarymember castObj = (Temporarymember)obj; 
			return ( castObj != null ) &&
				( this._cardid == castObj.Cardid );
		}
		
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			
			int hash = 57; 
			hash = 27 ^ hash ^ _cardid.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region IEquatable members

		public bool Equals(Temporarymember other)
		{
			if (other == this)
				return true;
		
			return ( other != null ) &&
				( this._cardid == other.Cardid );
				   
		}

		#endregion
		
	}
}
